/**创建一个音频对象*/
var moonAudio=()=>{
	// use one context per document. Here we are creating one context for one document. You can create for other documents also
	var context = new (window.AudioContext || window.webkitAudioContext)();

	//振荡器
	var os = context.createOscillator();  
	os.type = 'sine'; // sine is the default. So you can also use square, saw tooth, triangle
	os.frequency.value = 500; // setting the frequency Hz
	os.connect(context.destination); // connecting  to the destination

	// starting the振荡器
	os.start();  
	os.stop(context.currentTime + 5); // stop 5 seconds after the current time
}
class MSound{
	constructor() {
		//<audio id='sound_di' controls="controls" autobuffer="autobuffer" hidden="true"></audio>
		let audio = document.createElement('audio');
		audio.src = url;
		audio.hidden="true";
		audio.autoplay='true';
		document.body.appendChild(audio);
		this.audio=audio;
	}
	play(){				this.audio.play();	}
	pause(){			this.audio.pause();	}
	set volume(value){	this.audio.volume=value;}
	get volume(){return this.audio.volume;}
	set src(url){       this.autio.src=url;}
	get src(){   return this.autio.src;}
	setUrl(url){this.audio.src=url}
}